package com.ruoyi.cms.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.cms.mapper.CrmVisitorMapper;
import com.ruoyi.cms.domain.CrmVisitor;
import com.ruoyi.cms.service.ICrmVisitorService;

/**
 * 访客预约Service业务层处理
 * 
 * @author hct
 * @date 2022-10-06
 */
@Service
public class CrmVisitorServiceImpl implements ICrmVisitorService 
{
    @Autowired
    private CrmVisitorMapper crmVisitorMapper;

    /**
     * 查询访客预约
     * 
     * @param id 访客预约主键
     * @return 访客预约
     */
    @Override
    public CrmVisitor selectCrmVisitorById(Long id)
    {
        return crmVisitorMapper.selectCrmVisitorById(id);
    }

    /**
     * 查询访客预约列表
     * 
     * @param crmVisitor 访客预约
     * @return 访客预约
     */
    @Override
    public List<CrmVisitor> selectCrmVisitorList(CrmVisitor crmVisitor)
    {
        return crmVisitorMapper.selectCrmVisitorList(crmVisitor);
    }

    /**
     * 新增访客预约
     * 
     * @param crmVisitor 访客预约
     * @return 结果
     */
    @Override
    public int insertCrmVisitor(CrmVisitor crmVisitor)
    {
        crmVisitor.setCreateTime(DateUtils.getNowDate());
        return crmVisitorMapper.insertCrmVisitor(crmVisitor);
    }

    /**
     * 修改访客预约
     * 
     * @param crmVisitor 访客预约
     * @return 结果
     */
    @Override
    public int updateCrmVisitor(CrmVisitor crmVisitor)
    {
        crmVisitor.setUpdateTime(DateUtils.getNowDate());
        return crmVisitorMapper.updateCrmVisitor(crmVisitor);
    }

    /**
     * 批量删除访客预约
     * 
     * @param ids 需要删除的访客预约主键
     * @return 结果
     */
    @Override
    public int deleteCrmVisitorByIds(Long[] ids)
    {
        return crmVisitorMapper.deleteCrmVisitorByIds(ids);
    }

    /**
     * 删除访客预约信息
     * 
     * @param id 访客预约主键
     * @return 结果
     */
    @Override
    public int deleteCrmVisitorById(Long id)
    {
        return crmVisitorMapper.deleteCrmVisitorById(id);
    }
}
